package me.zhujin.java.learnjava.myserver.util;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * Created by zhujin on 10/20/16.
 * blog:www.zhujin.me
 * email: zhujin.nova@gmail.com
 */
public class CloseUtil {
    public static void closeSocket(ServerSocket socket) {
        try {
            if (null != socket) socket.close();
        } catch (IOException e) {
            e.printStackTrace();
        }


    }


    public static void closeSocket(Socket socket) {
        try {
            if (null != socket) socket.close();
        } catch (IOException e) {
            e.printStackTrace();
        }


    }
}
